package com.gs.netty.server;
import com.gs.netty.support.handler.channel.AbstractChannelDispatchHandler;
import com.gs.netty.support.codec.RequestResponseAggregator;
import com.gs.netty.websocket.remoting.WebSocketInvocation;
import com.gs.netty.websocket.remoting.resp.AppResponse;
import io.netty.channel.*;

/**
 * WebSocket 请求分发处理器
 */
@ChannelHandler.Sharable
public class WebSocketServerDispatchHandler extends AbstractChannelDispatchHandler<
        AbstractChannelDispatchHandler.WebSocketProcessor> {


    public WebSocketServerDispatchHandler(NettyServerConfig nettyServerConfig) {
        super(nettyServerConfig);
    }


    /**
     * 读数据

     * @throws Exception
     */
    @Override
    public void channelRead0(WebSocketInvocation webSocketInvocation,ChannelHandlerContext ctx) throws Exception {
        dispatch(webSocketInvocation, ctx);
    }
}